﻿using System.Windows.Forms;

namespace AGage.PolarExplorer
{
    public partial class PolarForm : Form
    {
        public PolarForm()
        {
            InitializeComponent();
        }

        public PolarPlot Plot
        {
            get { return polarPlot; }
        }

        private void cSVToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            string data = Clipboard.GetData(DataFormats.UnicodeText).ToString();
            if (data.Trim().Length < 100)
                return;
            Plot.Polar = new PerformancePolar(CSVPolarProvider.FromStringData(data));
            Text = "CSV Paste";
        }

        private void textToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            string data = Clipboard.GetData(DataFormats.StringFormat).ToString();
            if (data.Trim().Length < 100)
                return;
            Plot.Polar = new PerformancePolar(new TextPolarProvider(data));
            Text = data.Split('\n')[0].Trim();
        }
    }
}
